home *** CD-ROM | disk | FTP | other *** search
- /////////////////////////////
- // Harrow Software 96
- // Cannon shot definition
- //
-
- message "Please execute game_1.sxt"
- return
-
- initialize: my_sprite, my_bitmaps, xpos,ypos,u,v
- frame_pos = 0
- exploding = 0
-
- update_sprite:
- // get the current frame
- my_bitmap = my_bitmaps get frame_pos
- xmid = my_bitmap.xlen/2 // get offset from center
- ymid = my_bitmap.ylen/2
-
- sprite my_sprite bitmap my_bitmap at xpos-xmid, ypos-ymid depth ypos
-
- // if the last frame of animation has played then finish
- if exploding then frame_pos = frame_pos + 1
- if frame_pos >= my_bitmaps.max then return FALSE
-
- xpos = xpos + u // move the position of the shot
- ypos = ypos + v
-
- // if the shot has flown off the window then end
- if !(in_window xpos,ypos) then return FALSE
- return TRUE
-
- explode:
- exploding = TRUE
- frame_pos = 1
-